﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

/// <summary>
/// FeeDao 的摘要说明
/// </summary>
public class FeeDao
{
    public FeeDao()
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
    }

    public DataTable findById(long id)
    {
        string sql = "select * from itemoffees where ps_id = @ps_id";
        SqlCommand cmd = SqlHelper.OpenSqlConn().CreateCommand();
        cmd.CommandText = sql;
        cmd.Parameters.Add("@ps_id", SqlDbType.BigInt).Value = id;;
        SqlDataAdapter a = new SqlDataAdapter(cmd); 
        DataTable table = new DataTable();
        a.Fill(table);
        return table;
    }

    internal DataTable findAll()
    {
        string sql = "select * from itemoffees";
        SqlCommand cmd = SqlHelper.OpenSqlConn().CreateCommand();
        cmd.CommandText = sql;
        SqlDataAdapter a = new SqlDataAdapter(cmd);
        DataTable table = new DataTable();
        a.Fill(table);
        return table;
    }
}